package com.yx.modules.api.controller;

import com.yx.common.annotation.Log;
import com.yx.common.utils.R;
import com.yx.system.entity.TdBook;
import com.yx.system.entity.TdClassification;
import com.yx.system.service.TdClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 二级分类控制器
 */
@RestController
@RequestMapping("/api/classification")
public class TdClassificationController {

    @Autowired
    private TdClassificationService tdClassificationService;

    /**
     * 按ID查询二级分类
     *
     * @return
     */
    @PostMapping("findByUid")
    public R findByUId(int id) {
        return R.ok().put("classification", tdClassificationService.selectByPrimaryKey(id));
    }


}
